/*
 * @Author: lsmi
 * @Date: 2021-11-06 10:42:09
 * @LastEditors: lsmi
 * @LastEditTime: 2021-11-06 10:49:10
 * @FilePath: \base-typescript\src\MainThread.ts
 */
// 职程  就是Worker

let worker = new Worker('WorkerScript.js')
// 传给另一个线程
worker.postMessage('some date')
worker.onmessage = e => {
  console.log(e.data) // 职程传来的数据
}

